Gamma function problem